package com.soul.server.controller;

import com.soul.server.server.PeachblossomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author mdoya
 * @version 1.0
 * @description: 桃花传音控制层
 */
@Slf4j
@RestController
@RequestMapping("/peachblossom")
public class PeachblossomController {

    @Autowired
    private PeachblossomService peachblossomService;

    /**
     *  桃花传音-发送语音
     * @param soundFile 文件
     * @return null
     */
    @PostMapping
    public ResponseEntity sendPeachblossom(MultipartFile soundFile){
        return ResponseEntity.ok(peachblossomService.sendPeachblossom(soundFile));
    }

    /**
     *  桃花传音-接收语音
     * @return List<PeachblossomVo>
     */
    @GetMapping
    public ResponseEntity acceptPeachblossom(){
        return ResponseEntity.ok(peachblossomService.acceptPeachblossom());
    }

}
